<?php
use common\service\StaticService;
use backend\assets\AdminAsset;
use common\service\GlobalUrlService;

StaticService::includeAppJsStatic(GlobalUrlService::buildStaticUrl('/backend/content/update.js'),AdminAsset::class);
//StaticService::includeAppJsStatic(GlobalUrlService::buildStaticUrl('/backend/content/ckeditor.js'),AdminAsset::class);
StaticService::includeAppJsStatic(GlobalUrlService::buildStaticUrl('/js/ueditor/ueditor.config.js'),AdminAsset::class);
StaticService::includeAppJsStatic(GlobalUrlService::buildStaticUrl('/js/ueditor/ueditor.all.min.js'),AdminAsset::class);
StaticService::includeAppJsStatic(GlobalUrlService::buildStaticUrl('/js/ueditor/lang/zh-cn/zh-cn.js'),AdminAsset::class);
?>

<div class="widget">
    <div class="widget-title">
        <h4><i class="icon-reorder"></i>修改文章</h4>
    </div>
    <div class="widget-body form">
        <!-- BEGIN FORM-->
        <form method="post" action="#" class="form-horizontal">
            <input type="hidden" id="id" name="id" value="<?= $data['id'];?>" >
            <div class="control-group">
                <label class="control-label">文章标题</label>
                <div class="controls">
                    <input type="text" class="span6 menu-name" id="title" name="title" value="<?= $data['title'];?>">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">文章类型</label>
                <div class="controls">
                    <select class="span6 " name="type" id="type" data-placeholder="Choose a Category" tabindex="1">
                        <?php if ($data['type']==1){ ?>
                            <option value="1">关于我们</option>
                        <?php } ?>
                        <?php if ($data['type']==2){ ?>
                                <option value="2">常见问题</option>
                        <?php } ?>
                        <?php if ($data['type']==3){ ?>
                                <option value="3">免责声明</option>
                        <?php } ?>
                        <option value="1">关于我们</option>
                        <option value="2">常见问题</option>
                        <option value="3">免责声明</option>
                    </select>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">文章内容</label>
                <div class="controls">
                    <script id="editor" type="text/plain" style="width:100%;height: 400px"  class="content"><?= $data['content'];?></script>
                </div>
            </div>
            <div class="form-actions">
                <a><button type="button" class="btn btn-last-cancel" id="qued" style="margin-left:100px;">确定</button></a>
                <a href="<?= GlobalUrlService::buildAdminUrl('content/content')?>"><button type="button" class="btn btn-last-cancel" style="margin-left:100px;">取消</button></a>
            </div>
        </form>
        <!-- END FORM-->
    </div>
</div>
